home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / CALib & You… / Source / CASample / CAS_CAUtil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-07  |  3.5 KB  |  132 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        CAS_Extra.h
  3.  
  4.     Contains:    Constants and public function prototypes for CAS_Extra.c
  5.  
  6.     Written by:    Rick Badertscher
  7.  
  8.     Copyright © 1993-1995 ComponentWorks, All rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.         <5>        05/13/95    RB        Added CAUtil_IsCALibPresent()
  13.         <4>        04/01/95    RB        Added CAWindowActivateHandler()
  14.         <3>        03/30/95    RB        Added App_CAFocusLostProc() and App_CAFocusAquiredProc()
  15.  
  16.         <2>        03/16/95    RB        Added Read/Write Wrappers and CASaveDlgHook to
  17.                                     facilitate the Bento storage model
  18.  
  19.         <1>        02/21/95    RB        Created.
  20.         
  21. */
  22.  
  23. #if !defined(_H_CAS_Extra)
  24. #define _H_CAS_Extra
  25.  
  26. #include "CAS_Types.h"
  27.  
  28. // CustomGetFile dialog defines (Used by CA version for save dialog)
  29.  
  30. #define        kCASaveFileDialog            500
  31. #define        kNativeRadioItemID            13
  32. #define        kBentoRadioItemID            14
  33.  
  34. // These are the values returned in the CustomPutFile userData.
  35.  
  36. #define        kNativeStorageModel            0
  37. #define        kBentoStorageModel            1
  38.  
  39.  
  40. enum
  41. {
  42.     fileStream = 0,
  43.     memoryStream = 1
  44. };
  45.  
  46. struct IOStream
  47. {
  48.     short    type;        // 0 - file, 1 - buffer
  49.     DocPtr    theDoc;
  50.     short    fileRef;
  51.     Ptr        buffer;
  52. } ;
  53.     
  54. #if defined(__cplusplus)
  55. extern "C"
  56. {
  57. #endif
  58.  
  59. // CA Callbacks
  60.  
  61.  
  62. void        App_CAErrorHandler (            OSErr err, char* mesg);
  63.  
  64.  
  65. void        App_CASelectWindowProc(            WindowPtr window );
  66. void        App_CAFocusAcquiredProc(        CADocumentRef, CAFocusType );
  67. void        App_CAFocusLostProc(            CADocumentRef, CAFocusType );
  68. void        App_CAWindowActivateHandler(    WindowPtr    theWindow, Boolean activating);
  69. Boolean        App_CAAdjustBorderHandler(        CADocumentRef, CAFrameRef, RgnHandle);
  70.  
  71. WindowPtr    App_CAAllocWindowRecProc(        CAWindowLayer windowLayer );
  72. WindowPtr    App_CAFrontWindowProc(            CAWindowLayer windowLayer );
  73. Boolean        App_CAIsFloaterProc(            WindowPtr window );
  74. void        App_CADisposeWindowRecProc(        WindowPtr window );
  75.  
  76.  
  77. pascal Boolean    App_CAFrameShapeRequestHandler(        CADocumentRef        document,
  78.                                                     CAFrameRef            frameRef,
  79.                                                     RgnHandle            rgn);
  80.                                 
  81. OSErr        CAUtil_ShutdownCALib();
  82. OSErr        CAUtil_InitCALib();
  83.  
  84. // Misc. utiltities
  85.  
  86. // For dragging native content to/from the finder
  87. void        CAUtil_CreateDocFileFromSelection (    DocPtr theDoc, FSSpecPtr fsSpec);
  88. OSErr        CAUtil_AddItemsFromDocFile(            DocPtr theDoc, FSSpecPtr fsSpec, Point* origin);
  89.  
  90.  
  91. Boolean        CAUtil_HandleMouseDownBorder (        EventRecord*    theEvent,
  92.                                                 CAEventInfo*    eventInfo);
  93. Boolean        CAUtil_HandleMouseUpEmbedded (        EventRecord*    theEvent,
  94.                                                 CAEventInfo*    eventInfo);
  95.                                                 
  96. Boolean        CAUtil_HandleMouseDownEmbedded (    EventRecord*    theEvent,
  97.                                                 CAEventInfo*    eventInfo);
  98.  
  99. void        CAUtil_RecalcSelRgns(                DocPtr theDoc);
  100. void        CAUtil_InvalSelRgns (                DocPtr theDoc);
  101.  
  102. DocPtr        CAUtil_GetDocPtr (                    CADocumentRef document);
  103.  
  104. // Data transfer utiltities
  105.  
  106. void         CAUtil_EmbedODContainerFromCADocument(    DocPtr theDoc,
  107.                                                     CADocumentRef document,
  108.                                                     Point location);
  109.                                                     
  110. Boolean        CAUtil_ScrapHasType (                ResType type, long* scrapOffset, long* length);
  111. void        CAUtil_InsertMenu(                    WindowPtr theWindow);
  112. void        CAUtil_PartInfoMenu (                DocPtr theDoc);
  113. void        CAUtil_OpenSelectionMenu (            WindowPtr theWindow);
  114.  
  115. // Read/Write wrappers for CASample - Write to a file stream or a OD stream
  116.  
  117. OSErr        CAUtil_ReadWrapper    (                IOStreamPtr ioStream, Ptr buffer, long* length);
  118. OSErr        CAUtil_WriteWrapper    (                IOStreamPtr ioStream, Ptr buffer, long* length);
  119. OSErr        CAUtil_WriteTo(                        CADocumentRef doc, Ptr buffer, long* length);
  120.  
  121. Boolean        CAUtil_IsCALibPresent ();
  122.  
  123. pascal short CASaveDialogHook (short item, DialogPtr theDialog, void* userData);
  124.  
  125.  
  126. #if defined(__cplusplus)
  127. }
  128. #endif
  129.  
  130.  
  131. #endif
  132.